package com.suray.wcs.service.pojo.rgv.rgv.protocol.util;

public enum RgvTaskMessageType {
    INVALID_MESSAGE_TYPE(-1, "无效（按老版本处理）"),
    NORMAL_TASK_MESSAGE(1, "老版本任务报文"),
    EXTERN_TASK_NODE_MESSAGE(12, "扩展任务节点数量"),
    EX_TASK_NODE_WITH_SPEED_MSG(14, "扩展任务节点且带速度"),
    ;

    int value;
    String des;
    RgvTaskMessageType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public static RgvTaskMessageType parseValue(int value) {
        for (RgvTaskMessageType rgvTaskMessageType : RgvTaskMessageType.values()) {
            if (rgvTaskMessageType.value == value) {
                return rgvTaskMessageType;
            }
        }

        return INVALID_MESSAGE_TYPE;
    }


    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return des;
    }
}
